/**	
 * <br>
 * Copyright 2011 IFlyTek. All rights reserved.<br>
 * <br>			 
 * Package: com.iflytek.sjzx.projectgl.service.interfaces <br>
 * FileName: ProjectManagerService.java <br>
 * <br>
 * @version
 * @author Administrator
 */

package com.iflytek.ci.project.service;

import com.iflytek.iframework.orm.Page;
import com.iflytek.ci.project.domain.Project;

import java.util.List;

/**
 * <p>
 *       Project Manager operation service interface. <br />
 *      <ul>
 *          Mainly function list:<br />
 *          1.createNew(Project project)<br/>
 *              Create a new project.<br />
 *          2.deleteById(String id) <br />
 *              Delte the project with the given id(logic delete).<br />
 *          3.deleteByIds(String ids)  <br />
 *              Delete the projects with the given id collection.<br />
 *          4.changeStateByIds(String ids, String value)<br />
 *              Change the projects' state by the given id collection..<br />
 *          6.updateById(Project project)<br />
 *              Update the project's base information with the given id..<br />
 *          7.selectById(String id) <br />
 *              Query tht project object by the given id.<br />
 *          8.selectPageByActive(Page<Project> page, Project project):Create a new project.<br />
 *              Query the pagination list of projects with the query condition packaged with project parameter.
 *          9.selectListByActive(Project project)<br />
 *              Query the list of projects with the query condition packaged with project parameter.
 *          9.selectListByFwid(String id) <br />
 *              Query the project with the relative service's id<br />
 *      </ul>
 * </p>
 *
 * @author yali
 */

public interface ProjectManagerService {
    /**
     * Create a new project.
     * 
     * @param project
     *         The project object.
     * @author yali
     * @return
     *         The new project's id.
     */
    public Long createNew(Project project);

    /**
     * 
     *  Delete the project with the given id(logic delete).
     * 
     * @param id
     *            The id of the project to be deleted.
     *
     * @author yali
     * @return
     *          The number of the deleted records.
     */
    public int deleteById(String id);

    /**
     * 
     * Update the projects' state with the given id collection.
     * 
     * @param ids
     *            The  id collection(seperated with comma).eg "12,345,10".
     * @param value
     *           The state value to be changed.

     * @author yali
     * @return
     *          The number of updated records.
     */
    public int changeStateByIds(String ids, String value);

    /**
     * Update the project with it's id.
     * 
     * @param project
     *            The project object.
     * @author yali
     * @return
     *          The record's number to be updated.
     */
    public int updateById(Project project);

    /**
     * Query tht project object by the given id.
     * 
     * @param id
     *           The project's id.
     * @author yali
     * @return
     *          The project's object.
     */
    public Project selectById(String id);

    /**
     *  Query the pagination list of projects with the query condition packaged with project parameter.
     * 
     * @param page
     *          The pagination condition.
     * @param project
     *          The query conditions packaged with a project object.
     *           eg:
     *            projectName : project's name (support Fuzzy query)
     *            resourceType : the code of the poject's type.
     *            ownerSystem : the system's id which this project subordinated.
     *            etc.
     * @author yali
     * @return
     *          The pagination list result.
     */
    public Page<Project> pageProject(Page<Project> page, Project project);

}
